// 监听达人介绍瞄点
$('.to-tang-intro').on('click', function() {
  _hmt.push(['_trackEvent', 'daren_intro', 'click', '0']);
});

//监听达人分享埋点
$('.to-tang-share').on('click', function() {
  _hmt.push(['_trackEvent', 'daren_share', 'click', '0']);
});

//监听达人笔记埋点
$('.to-tang-note').on('click', function() {
  _hmt.push(['_trackEvent', 'daren_note', 'click', '0']);
});

//监听展开全文埋点
$('.show-tang-2').on('click', function() {
  _hmt.push(['_trackEvent', 'show_intro', 'click', '0']);
});

//监听视频埋点
$('.btn-start-tv').on('click', function() {
  _hmt.push(['_trackEvent', 'watch_tv', 'click', '0']);
});

//监听文章点击数
$('.note-1').on('click', function() {
  _hmt.push(['_trackEvent', 'note_1', 'click', '0']);
});

$('.note-2').on('click', function() {
  _hmt.push(['_trackEvent', 'note_2', 'click', '0']);
});

$('.note-3').on('click', function() {
  _hmt.push(['_trackEvent', 'note_3', 'click', '0']);
});

//监听下载按钮
$('.img-download-app').on('click', function() {
  _hmt.push(['_trackEvent', 'download_app', 'click', '0']);
});

$(function () {
  var videoPlay = document.getElementById('videoPlay');
  if(flag == 'android'){
    $('.img-focus-tang').hide();
    $('.img-download-app').hide();
    $('.btn-close-download').hide();
  }else if(flag == 'ios'){
    $('.img-download-app').hide();
  }else if(flag == 'no'){
    $('.img-focus-tang').hide();
  }

  //展示人物介绍
  $('.show-tang-2').on('click',function () {
    $('.tang-intro-3').show();
    $('.show-tang-2').hide();
  })

  // 打开视频
  $('.btn-start-tv').on('click',function () {
    $('.btn-start-tv').hide();
    $('.video-play').show();
    videoPlay.play();
  })

  //关闭视频
  videoPlay.addEventListener('pause',function () {
    $('.btn-start-tv').show();
    $('.video-play').hide();
  })

  //打开文章
  $('.img-note').on('click',function () {
    var index = $(this).attr('index');
    if(index == 1){
      window.location.href="https://h5.lalocal.cn/article?id=92";
    }else if(index ==2){
      window.location.href="https://h5.lalocal.cn/article?id=196"
    }
    else if(index == 3){
      window.location.href='https://h5.lalocal.cn/article?id=194';
    }
  })

  //关闭下载按钮
  $('.btn-close-download').on('click',function () {
    $('.img-download-app').fadeOut('1000');
    $('.btn-close-download').fadeOut('1000');
    $('.img-focus-tang').hide();
  })

  //下载app
  $('.img-download-app').on('click',function () {
    window.location.href='http://a.app.qq.com/o/simple.jsp?pkgname=com.lalocal.lalocal';
  })

  //关注汤子
  $('.img-focus-tang').on('click',function () {
    window.location.href='lalocal://app?{"targetType": "12","targetId": "8571"}'
  })
})
